<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    .tt{width: 15%!important;}
    .tv{width: 35%!important;}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox" style="padding-bottom: 200px">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="table-box tablenes">
            <div class="title">工程承揽信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程名称</td><td class="tv colorlan" id="name"></td><td class="tt">工程编号</td><td class="tv" id="number"></td></tr>
                <tr><td class="tt">业务归属</td><td class="tv" id="gui_unit_name"></td><td class="tt">工程管理文件汇编</td><td class="tv colorlan" id="neiname"></td></tr>
                <tr><td class="tt">工程负责人</td><td class="tv colorlan" id="gofuer"></td><td class="tt">负责人联系电话</td><td class="tv" id="gofutel"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">税(费)收取标准(方式)</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">劳务分包服务费收取标准(%)</td><td class="tv" id="ratefu"></td><td class="tt">税款保证金收取标准(%)</td><td class="tv" id="rateshui"></td></tr>
                <tr><td class="tt">是否提供进项</td><td class="tv" id="ispiao"></td><td class="tt">签订状态</td><td class="tv" id="state_name"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">工程款信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">中标价/施工合同金额(元)</td><td class="tv colorlan" id="shimoney"></td><td class="tt">施工合同结算金额(元)</td><td class="tv colorlan" id="shijiemoney"></td></tr>
                <tr><td class="tt">已开具销项发票金额(元)</td><td class="tv colorlan" id="piaokaifee"></td><td class="tt">累计回款金额(元)</td><td class="tv colorlan" id="gonghuimoney"></td></tr>
                <tr><td class="tt">回款未开票金额(元)</td><td class="tv" id="huinokai"></td><td class="tt">开票未回款金额(元)</td><td class="tv" id="kainohui"></td></tr>
                <tr><td class="tt">已开具销项发票占比(%)</td><td class="tv" id="leixiaobi"></td><td class="tt">累计回款金额占比(%)</td><td class="tv" id="leihuibi"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">工程收取信息（不区分资金渠道）</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">应收取劳务分包服务费(元)</td><td class="tv" id="yingkoufuwu"></td><td class="tt">已收取劳务分包服务费(元)A</td><td class="tv colorlan" id="yikoufuwu"></td></tr>
                <tr><td class="tt">应收取税款保证金(元)</td><td class="tv" id="yingkoushuifei"></td><td class="tt">已收取税款合计含利息(元)B</td><td class="tv" id="yishoushuili"></td></tr>
                <tr><td class="tt">其中收取承若书税款含利息(元)</td><td class="tv colorlan" id="yikoushuifei"></td><td class="tt">其中直接收取税款(元)</td><td class="tv colorlan" id="yiqifeizhi"></td></tr>
                <tr><td class="tt">应收取快递费(元)</td><td class="tv colorlan" id="yingkuaifei"></td><td class="tt">已收取快递费(元)C</td><td class="tv colorlan" id="yikuaifei"></td></tr>
                <tr><td class="tt">直接收取不含税款(元)D</td><td class="tv colorlan" id="yiqifei"></td><td class="tt">累计已收取(元)A+B+C+D</td><td class="tv" id="leikoushoufee"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">工程回款支出（从本工程回款列支）</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">本工程累计工程回款(元)E</td><td class="tv colorlan" id="gonghuimoney2"></td><td class="tt">本工程回款累计支付(元)F</td><td class="tv colorlan" id="gongzhimoneyquben"></td></tr>
                <tr><td class="tt">本工程回款累计收取(元)G</td><td class="tv colorlan" id="gonghuikoufee"></td><td class="tt">其中暂扣合计(元)</td><td class="tv colorlan" id="qizankoufee"></td></tr>
                <tr><td class="tt">暂扣解冻合计(元)H</td><td class="tv colorlan" id="jiedongkoufee"></td><td class="tt">本工程回款预留金额(元)</td><td class="tv" id="yuliufee"></td></tr>
                <tr><td class="tt">本工程回款可用余额(元)E-F-G+H</td><td class="tv" id="gonghui_keyu" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <div class="title">工程支出信息（不区分资金渠道）</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程收支差额(元)</td><td class="tv" id="gongshouzhicha" colspan="3"></td></tr>
                <tr><td class="tt">累计工程付款(元)</td><td class="tv colorlan" id="gongzhimoney"></td><td class="tt">其中工程款付款(元)</td><td class="tv colorlan" id="gongzhimoney_dang"></td></tr>
                <tr><td class="tt">其中预收款付款(元)</td><td class="tv colorlan" id="gongzhimoney_yufu"></td><td class="tt">其中其他工程付款(元)</td><td class="tv colorlan" id="gongzhimoney_qita"></td></tr>
                <tr><td class="tt">工程累计支付销售方(元)</td><td class="tv colorlan" id="gongzhimoneygogong"></td><td class="tt">其中工程款支付销售方(元)</td><td class="tv colorlan" id="gongzhimoneygogong_dang"></td></tr>
                <tr><td class="tt">其中预收款支付销售方(元)</td><td class="tv colorlan" id="gongzhimoneygogong_yufu"></td><td class="tt">其中其他工程支付销售方(元)</td><td class="tv colorlan" id="gongzhimoneygogong_qita"></td></tr>
                <tr><td class="tt">已登记进项发票金额(元)</td><td class="tv colorlan" id="piaoshoumoney"></td><td class="tt">进项发票税额(元)</td><td class="tv colorlan" id="piaoshouratefee"></td></tr>
                <tr><td class="tt">工程采购合同金额(元)</td><td class="tv colorlan" id="contractcaimoney"></td><td class="tt">工程采购合同结算金额(元)</td><td class="tv colorlan" id="contractcaijiemoney"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">工程退税信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程累计进项抵扣退税(元)</td><td class="tv colorlan" id="hougongshuimoney"></td><td class="tt"></td><td class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">工程检查及整改</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程检查待整改</td><td class="tv colorlan" id="cha_dainum"></td><td class="tt"></td><td></td></tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_engin_xiang, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;



                $("#name").text(data.name).click(function () {
                    openPage('../engin/show.php?id='+data.id);
                });
                $(".pageshowtitle").html(data.name);
                $("#number").text(data.number);
                $("#gui_unit_name").text(data.gui_unit_name);
                $("#gofuer").text(data.gofuer).click(function () {
                    openNavPage('工程负责人信息','engin/gofuer.php?gofuer='+encodeURI(data.gofuer));
                });
                $("#gofutel").text(data.gofutel);

                var neiinfo = res.data.neiinfo
                if(neiinfo){
                    $("#neiname").text(neiinfo.name).click(function () {
                        openPage('../contract_nei/show.php?id='+neiinfo.id);
                    });
                    $("#ratefu").text(neiinfo.ratefu);
                    $("#rateshui").text(neiinfo.rateshui);
                    $("#ispiao").text(neiinfo.ispiao);
                    $("#state_name").text(neiinfo.state_name);
                }


                var shiinfo = res.data.shiinfo
                var bidinfo = res.data.bidinfo
                if(shiinfo){
                    $("#shimoney").html(parseFormatNum(shiinfo.money)).click(function () {
                        openPage('../contract_shi/show.php?id='+shiinfo.id);
                    });
                }else{
                    if(data.winfee){
                        $("#shimoney").html(parseFormatNum(data.winfee)).click(function () {
                            openPage('../engin/show.php?id='+data.id);
                        });
                    }
                }
                if(res.data.shijiemoney){
                    $("#shijiemoney").text(parseFormatNum(res.data.shijiemoney)).click(function () {
                        openNavPage('施工合同结算信息','contract_shi_jie/index.php?enginid='+param_id);
                    });
                }
                if(res.data.piaokaifee){
                    $("#piaokaifee").text(parseFormatNum(res.data.piaokaifee)).click(function () {
                        openNavPage('销项票明细信息','piao_kai/detail.php?enginid='+param_id);
                    });
                }
                if(res.data.gonghuimoney){
                    $("#gonghuimoney").text(parseFormatNum(res.data.gonghuimoney)).click(function () {
                        openNavPage('工程回款信息','hou_gonghui/index.php?enginid='+param_id);
                    });
                }
                $("#huinokai").text(parseFormatNum(res.data.huinokai));
                if(res.data.kainohui > 0){
                    $("#kainohui").html('<span class="colorhong">'+parseFormatNum(res.data.kainohui)+'</span>');
                }else{
                    $("#kainohui").text(parseFormatNum(res.data.kainohui));
                }
                $("#leixiaobi").text(parseFormatNum(res.data.leixiaobi));
                $("#leihuibi").text(parseFormatNum(res.data.leihuibi));


                if(res.data.gongshouzhicha > 0){
                    $("#gongshouzhicha").text(parseFormatNum(res.data.gongshouzhicha));
                }else{
                    $("#gongshouzhicha").html('<span class="colorhong">'+parseFormatNum(res.data.gongshouzhicha)+'</span>');
                }
                if(res.data.gongzhimoney){
                    $("#gongzhimoney").text(parseFormatNum(res.data.gongzhimoney)).click(function () {
                        openNavPage('工程付款信息','hou_gongzhi/index.php?enginid='+param_id+'&status=1');
                    });
                }
                if(res.data.gongzhimoney_dang){
                    $("#gongzhimoney_dang").text(parseFormatNum(res.data.gongzhimoney_dang)).click(function () {
                        // openNavPage('工程付款信息','hou_gongzhi/detail.php?enginid='+param_id+'&status=1&qutype=2');
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qutype=2&enginid='+param_id);
                    });
                }
                if(res.data.gongzhimoney_yufu){
                    $("#gongzhimoney_yufu").text(parseFormatNum(res.data.gongzhimoney_yufu)).click(function () {
                        // openNavPage('工程付款信息','hou_gongzhi/detail.php?enginid='+param_id+'&status=1&qutype=1');
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qutype=1&enginid='+param_id);
                    });
                }
                if(res.data.gongzhimoney_qita){
                    $("#gongzhimoney_qita").text(parseFormatNum(res.data.gongzhimoney_qita)).click(function () {
                        // openNavPage('工程付款信息','hou_gongzhi/detail.php?enginid='+param_id+'&status=1&qutype=3');
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qutype=3&enginid='+param_id);
                    });
                }


                if(res.data.gongzhimoneygogong){
                    $("#gongzhimoneygogong").text(parseFormatNum(res.data.gongzhimoneygogong)).click(function () {
                        openNavPage('工程付款信息','hou_gongzhi/detail.php?dealtype=3&enginid='+param_id);
                    });
                }
                if(res.data.gongzhimoneygogong_dang){
                    $("#gongzhimoneygogong_dang").text(parseFormatNum(res.data.gongzhimoneygogong_dang)).click(function () {
                        // openNavPage('工程付款信息','hou_gongzhi/detail.php?dealtype=3&qutype=2&enginid='+param_id);
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qutype=2&dealtype=3&enginid='+param_id);
                    });
                }
                if(res.data.gongzhimoneygogong_yufu){
                    $("#gongzhimoneygogong_yufu").text(parseFormatNum(res.data.gongzhimoneygogong_yufu)).click(function () {
                        // openNavPage('工程付款信息','hou_gongzhi/detail.php?dealtype=3&qutype=1&enginid='+param_id);
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qutype=1&dealtype=3&enginid='+param_id);
                    });
                }
                if(res.data.gongzhimoneygogong_qita){
                    $("#gongzhimoneygogong_qita").text(parseFormatNum(res.data.gongzhimoneygogong_qita)).click(function () {
                        // openNavPage('工程付款信息','hou_gongzhi/detail.php?dealtype=3&qutype=3&enginid='+param_id);
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qutype=3&dealtype=3&enginid='+param_id);
                    });
                }


                if(res.data.piaoshoumoney){
                    $("#piaoshoumoney").text(parseFormatNum(res.data.piaoshoumoney)).click(function () {
                        openNavPage('进项票信息','piao_shou/index.php?enginid='+param_id);
                    });
                }
                if(res.data.piaoshouratefee){
                    $("#piaoshouratefee").text(parseFormatNum(res.data.piaoshouratefee)).click(function () {
                        openNavPage('进项票信息','piao_shou/index.php?enginid='+param_id);
                    });
                }
                if(res.data.contractcaimoney){
                    $("#contractcaimoney").text(parseFormatNum(res.data.contractcaimoney)).click(function () {
                        openNavPage('采购合同信息','contract_cai/index.php?sttaus=1&enginid='+param_id);
                    });
                }
                if(res.data.contractcaijiemoney){
                    $("#contractcaijiemoney").text(parseFormatNum(res.data.contractcaijiemoney)).click(function () {
                        openNavPage('采购合同结算信息','contract_cai_jie/index.php?sttaus=1&enginid='+param_id);
                    });
                }
                if(res.data.hougongshuimoney){
                    $("#hougongshuimoney").text(parseFormatNum(res.data.hougongshuimoney)).click(function () {
                        openNavPage('进项抵扣退税信息','hou_gongshui/index.php?enginid='+param_id);
                    });
                }




                $("#yingkoufuwu").text(parseFormatNum(res.data.yingkoufuwu));
                if(res.data.yikoufuwu){
                    $("#yikoufuwu").text(parseFormatNum(res.data.yikoufuwu)).click(function () {
                        openNavPage('收取劳务分包服务费信息','hou_chi_kou_fuwu/index.php?enginid='+param_id);
                    });
                }
                $("#yingkoushuifei").text(parseFormatNum(res.data.yingkoushuifei));
                $("#yishoushuili").text(parseFormatNum(res.data.yishoushuili));
                if(res.data.yikoushuifei){
                    $("#yikoushuifei").text(parseFormatNum(res.data.yikoushuifei)).click(function () {
                        openNavPage('收取税款含利息信息','hou_chi_kou_shuifei/index.php?enginid='+param_id);
                    });
                }
                if(res.data.yingkuaifei){
                    $("#yingkuaifei").text(parseFormatNum(res.data.yingkuaifei)).click(function () {
                        openNavPage('快递费汇总信息','kuai_hui/index.php?enginid='+param_id);
                    });
                }
                if(res.data.yikuaifei){
                    $("#yikuaifei").text(parseFormatNum(res.data.yikuaifei)).click(function () {
                        openNavPage('收取快递费信息','hou_chi_kou_kuaifei/index.php?enginid='+param_id);
                    });
                }
                if(res.data.yiqifeizhi){
                    $("#yiqifeizhi").text(parseFormatNum(res.data.yiqifeizhi)).click(function () {
                        openNavPage('直接收取信息','hou_chi_kou_qifei/index.php?sou_houkou=two&enginid='+param_id);
                    });
                }
                if(res.data.yiqifei){
                    $("#yiqifei").text(parseFormatNum(res.data.yiqifei)).click(function () {
                        openNavPage('直接收取信息','hou_chi_kou_qifei/index.php?sou_houkou=notwo&enginid='+param_id);
                    });
                }


                $("#leikoushoufee").text(parseFormatNum(res.data.leikoushoufee));



                if(res.data.gonghuimoney){
                    $("#gonghuimoney2").text(parseFormatNum(res.data.gonghuimoney)).click(function () {
                        openNavPage('工程回款信息','hou_gonghui/index.php?enginid='+param_id);
                    });
                }
                if(res.data.gongzhimoneyquben){
                    $("#gongzhimoneyquben").text(parseFormatNum(res.data.gongzhimoneyquben)).click(function () {
                        openNavPage('工程支付明细信息','hou_chi_gongzhi/index.php?qu_enginid='+param_id);
                    });
                }
                if(res.data.gonghuikoufee){
                    $("#gonghuikoufee").text(parseFormatNum(res.data.gonghuikoufee)).click(function () {
                        openNavPage('工程回款信息','hou_gonghui/index.php?enginid='+param_id);
                    });
                }
                if(res.data.qizankoufee){
                    $("#qizankoufee").text(parseFormatNum(res.data.qizankoufee)).click(function () {
                        openNavPage('直接扣收明细信息','hou_chi_kou_qifei/index.php?status=1&enginid='+param_id+'&kouxing='+encodeURI('暂扣'));
                    });
                }
                $("#yuliufee").text(parseFormatNum(res.data.yuliufee));


                if(res.data.jiedongkoufee){
                    $("#jiedongkoufee").text(parseFormatNum(res.data.jiedongkoufee)).click(function () {
                        openNavPage('直接收取信息','hou_chi_kou_qifei/index.php?isdong=1&enginid='+param_id);
                    });
                }
                $("#gonghui_keyu").text(parseFormatNum(res.data.gonghui_keyu));



                if(res.data.cha_dainum){
                    $("#cha_dainum").text(parseFormatNum(res.data.cha_dainum)).click(function () {
                        openNavPage('工程检查信息','engin_cha/index.php?status=1&enginid='+param_id+'&isxu='+encodeURI('是')+'&iszheng='+encodeURI('否'));
                    });
                }

                render_from();
            }
        });

    });






</script>
</body>
</html>




